package com.handle.system.svc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.handle.system.api.entity.SysRole;
import com.handle.system.api.request.role.RoleQueryParam;
import com.handle.system.api.response.role.Permission;
import com.handle.system.api.response.role.RoleDetailsVo;
import com.handle.system.api.response.role.RoleListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统角色表 Mapper 接口
 * </p>
 *
 * @author zhangqing
 * @since 2021-03-05
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    List<Permission> findRolePermissions(Long roleId);

    List<RoleListVo> findRolePage(RoleQueryParam roleQueryParam);

    List<Permission> findMenu();

    /**
     * 批量删除角色信息
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    int delRoleByIds(@Param("ids")List<Long> ids);

    RoleDetailsVo roleDetails(Long roleId);

}
